Ext.define('Admin.view.stats.EnergyReportController', {
	        extend : 'Admin.app.BaseController',
	        alias : 'controller.energyreport',

	        onEnergyReportRefresh : function(view, record, params) {
		        var me = this, vm = me.getViewModel();

		        var queryDate = params && params.queryDate ? params.queryDate : vm.get('queryDate');
		        var metric = params && params.metric ? params.metric : vm.get('metric');
		        var interval = params && params.interval ? params.interval : vm.get('metric');

		        queryDate = Ext.Date.format(queryDate, 'Y-m-d');
		        var url = Ext.String.format('/rest/rpt/chart/period?object={0}&metric={1}&date={2}&cycle={3}',
		                record.data.id, metric, queryDate, interval);
		        vm.set('echartUrl', url);
	        }

        });
